package cn.lxm.cas.client2.filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.Arrays;

@Configuration
@Component
public class FilterConfig {
    @Bean
    public FilterRegistrationBean ignoreSSLValidateFilter(){
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(new IgnoreSSLValidateFilter());
        registrationBean.setName("ignoreSSLValidateFilter");
        //过滤器顺序
        registrationBean.setOrder(0);
        //拦截规则
        registrationBean.setUrlPatterns(Arrays.asList("/*"));
        return registrationBean;

    }
}
